package Method_References;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class number6 {
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	System.out.println("请输入第一个数组,用空格分开：");
	String input1 = sc.nextLine();
	int[] array = Arrays.stream(input1.split(" ")).mapToInt(Integer::parseInt).toArray();
	
	System.out.println("请输入第二个数组,用空格分开：");
	String input2 = sc.nextLine();
	int[] array2 = Arrays.stream(input2.split(" ")).mapToInt(Integer::parseInt).toArray();
	
	ArrayList<Integer> list = new ArrayList<>();

	Arrays.stream(array).forEach(c->list.add(c));
	
	Arrays.stream(array2).forEach(c->{
		if(list.contains(c)) {
			list.remove(list.indexOf(c));
		}else {
			list.add(c);
		}
	});
	
	System.out.println(list);
}
}
